﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Marbles.Core.Web.Controls
{
    public class PopupMenuItemCollection : CollectionBase
    {
        public PopupMenuItem this[int index]
        {
            get
            {
                return ((PopupMenuItem)List[index]);
            }
            set
            {
                List[index] = value;
            }
        }

        public int Add(PopupMenuItem value)
        {
            return (List.Add(value));
        }

        public int IndexOf(PopupMenuItem value)
        {
            return (List.IndexOf(value));
        }

        public void Insert(int index, PopupMenuItem value)
        {
            List.Insert(index, value);
        }

        public void Remove(PopupMenuItem value)
        {
            List.Remove(value);
        }

        public bool Contains(PopupMenuItem value)
        {
            return (List.Contains(value));
        }

        protected override void OnValidate(Object value)
        {
            if (value.GetType() != typeof(PopupMenuItem)) { throw new ArgumentException("value must be of type PopupMenuItem.", "value"); }
        }
    }
}
